package com.example.administrator.myapplication.splash;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.example.administrator.myapplication.MainActivity;
import com.example.administrator.myapplication.R;
import com.example.administrator.myapplication.login.AccountActivity;

public class SplashActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        //异步线程处理机制
        Handler handler = new Handler();
        handler.postDelayed(new SplashHandler(),Integer.parseInt(this.getString(R.string.splash_pause_time)));
    }
    class SplashHandler implements Runnable{
        @Override
        public void run() {
            startActivity(new Intent(getApplication(), AccountActivity.class));
            SplashActivity.this.finish();
        }
    }
}
